﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Base.Entity;
using T.FAS.Runtime.Metadata.Entity.DataModel;

namespace T.FAS.Runtime.StateMachine.SPI
{
    public interface IActionProcess
    {
        /// <summary>
        /// 动作标识
        /// </summary>
        string Key { get; }

        /// <summary>
        /// 动作描述
        /// </summary>
        string Description { get; }

        /// <summary>
        /// 需要赋值的参数信息
        /// </summary>
        List<ParamInfo> NeedParamInfo { get; }

        /// <summary>
        /// 动作处理
        /// </summary>
        /// <param name="record">记录</param>
        /// <param name="action">action定义</param>
        /// <param name="metadata">状态机元数据</param>
        /// <returns>处理结果</returns>
        TRecord Do(TRecord record, TAction action, StateMachineMetadata metadata, Dictionary<string, object> extParams = null);
    }
}
